Exchange API icon

Exchange API

(0 reviews)

Public Portal

Public portal provides a way to enable developers outside of an organization to access that organization’s REST, SOAP, HTTP APIs, and API Groups that have been shared with the public portal.

Exchange public portals replace what used to be known as developer portals.

Customize the public portal

You can customize the appearance and the content of the portal by adding text and custom pages with content.

Note: logo, banner image, favicon, and images for page content will be eventually available in the Exchange API v2

Following there are exposed some examples about how to customize the public portal

Before executing the examples, read the Anypoint Platform Token section to know how to obtain the token to be used in the examples. This should be replaced for the value ANYPOINT_TOKEN in each curl example.

The examples have been made by cURL, but optionally, instead of sending HTTP commands with cURL, you can use Postman or another application.

Consider for the examples that the URL parameter :domain is the domain of the public portal we are editing, and it should be replaced.

How to obtain the domain given a master organization

To get the domain of a master organization, this request should be executed, replacing :organizationId by the id of the master organization

curl --location --request GET 'https://anypoint.mulesoft.com/accounts/api/organizations/:organizationId' \
    -H 'Authorization: bearer ANYPOINT_TOKEN' | jq -r ".domain"

How to create a new page into the public portal draft

To create a new page in the public portal draft for a particular domain :domain this example could be followed.

The page will be added as a draft until the public portal is published. In this case, the new page to be created is newPage as pathPath (it is indicated after the -d flag):

  curl 'https://anypoint.mulesoft.com/exchange/api/v1/organizations/:domain/portal/draft/pages' \
    -H 'accept: application/json' \
    -H 'authorization: bearer ANYPOINT_TOKEN' \
    -H 'content-type: application/json' \
    -d '{"pagePath":"newPage"}'

How to upload content for a page

To override the markdown content of the page :pageId (pagePath) that has been created before for a particular domain :domain this example could be followed. The content will be added as a draft until the public portal is published.

The markdown content is specified after the -d flag. In this case, it is This is the markdown content\n for this page.

  curl 'https://anypoint.mulesoft.com/exchange/api/v1/organizations/:domain/portal/draft/pages/:pageId \
    -X 'PUT' \
    -H 'accept: application/json' \
    -H 'authorization: bearer ANYPOINT_TOKEN' \
    -H 'content-type: text/markdown' \
    -d 
__COMPONENT_PLACEHOLDER__
#39;This is the markdown content\n for this page'

How to customize the content of the public portal (draft mode)

This is the content can be customized for a public portal:
For the home:
welcomeTitle: The main title shown at the home page of the public portal
welcomeText: The subtitle shown at the home page of the public portal
textColor: The color of the welcomeTitle and welcomeText

For the navbar:
backgroundColor: The background color of the navbar
textColor: The color of pages on the navbar
textColorActive: The color of the selected page on the navbar

For the custom pages:
name: The name of a page already created in the portal (as it has been explained before)
path: The path on the browser of the page that will be shown

Use this example to upload the content of the public portal in the draft mode. Remember that the final content will be available for the rest of the users when the public portal is published.

The described content can be edited after the -d flag.

curl 'https://anypoint.mulesoft.com/exchange/api/v1/organizations/:domain/portal/draft' \
  -X 'PUT' \
  -H 'accept: application/json' \
  -H 'authorization: bearer ANYPOINT_TOKEN' \
  -H 'content-type: application/json' \
  -d '{"customization":{"home":{"welcomeTitle":"New welcome title","welcomeText":"Welcome text","textColor":"#fffff0"},"navbar":{"backgroundColor":"#262128","textColor":"#fffff0","textColorActive":"#00a2dA"}},"pages":[{"name":"newPage","path":"newPage"}]}'

How to publish the draft content of the public portal

Use this example to publish the content of the public portal that is in the draft mode. Once the portal is published, all the customization will be available for the rest of the users.

  curl 'https://anypoint.mulesoft.com/exchange/api/v1/organizations/:domain/portal' \
    -X 'PATCH' \
    -H 'accept: application/json' \
    -H 'authorization: bearer ANYPOINT_TOKEN'

Vanity domain

A vanity domain is a domain name used with the purpose of representing the person who registered it. It is personalized to communicate who owns it.

In this case, a vanity domain can be used to refer to the organization that owns a public portal.

To see how a vanity domain can be configured, see the following article:

https://docs.mulesoft.com/exchange/portal-vanity-domain

For more information about portal customization, see:

https://docs.mulesoft.com/exchange/to-customize-portal


Reviews